package day20160813;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;

public class Gson20160816 {
	public static void main(String[] args) {
		try{
			Reader reader = new FileReader("json1.json");
			Gson gson = new Gson();
			GsonBuilder gb = new GsonBuilder();
			Gson gson2 = gb.setPrettyPrinting().create();
			List<Json> J = gson.fromJson(reader,new TypeToken<List<Json>>(){}.getType());
			System.out.println(gson2.toJson(J));
		}catch (IOException e){
			e.printStackTrace();
		}
	}
}